/**
 * 
 */
package ccrClasses.layer2;

import ccrClasses.ICcr;

/**
 * @author matheus
 *
 */
public class Product implements ICcr {
	
	public final static String OPEN_TAG = "<Product>";

	public final static String CLOSE_TAG = "</Product>";
	
	private ProductName productName;
	
	private Strength strength;
	
	private Form form;
	
	public Product(ProductName productName, Strength strength, Form form) {
		super();
		this.productName = productName;
		this.strength = strength;
		this.form = form;
	}
	
	public Product(ProductName productName) {
		super();
		this.productName = productName;
	}
	
	public Product(Strength strength) {
		super();
		this.strength = strength;
	}	

	public Product(Form form) {
		super();
		this.form = form;
	}
	
	public Product() {
		super();
	}

	/* (non-Javadoc)
	 * @see ccrClasses.ICcr#constructCcrString()
	 */
	@Override
	public String constructCcrString() {
		String ccrProduct = OPEN_TAG;
		if(productName != null){
			ccrProduct = ccrProduct + productName.constructCcrString();
		}
		
		if(strength != null){
			ccrProduct = ccrProduct + strength.constructCcrString();
		}

		if(form != null){
			ccrProduct = ccrProduct + form.constructCcrString();	
		}
		
		ccrProduct = ccrProduct + CLOSE_TAG;
		
		return ccrProduct;
	}

	/**
	 * @return the productName
	 */
	public ProductName getProductName() {
		return productName;
	}

	/**
	 * @param productName the productName to set
	 */
	public void setProductName(ProductName productName) {
		this.productName = productName;
	}

	/**
	 * @return the strength
	 */
	public Strength getStrength() {
		return strength;
	}

	/**
	 * @param strength the strength to set
	 */
	public void setStrength(Strength strength) {
		this.strength = strength;
	}

	/**
	 * @return the form
	 */
	public Form getForm() {
		return form;
	}

	/**
	 * @param form the form to set
	 */
	public void setForm(Form form) {
		this.form = form;
	}

}
